package net.mysoft.budgetsoft.system.domain.comparator;

import java.util.Comparator;

import net.mysoft.budgetsoft.system.pagemodel.FlowTaskNode;

/**
 * 排序
 * 
 * @author liuyang
 * 
 */
public class FlowTaskNodeComparator implements Comparator<FlowTaskNode> {

	public int compare(FlowTaskNode o1, FlowTaskNode o2) {
		if(o1.getFtn_HandleBeginTime()!=null&&o2.getFtn_HandleEndTime()!=null){
			if(o1.getFtn_HandleBeginTime().getTime()-o2.getFtn_HandleEndTime().getTime()>0){
				return 1;
			}else{
				return -1;
			}
		}else{
			if(o1==null){
				return -1;
			}
			if(o2==null){
				return 1;
			}
			return 0;
		}
	}

}
